"""
maketrans(字符串1, 字符串2) 用来做密码本的
translate(替换策略) 用来对信息加密
"""

dict1 = "".maketrans("abcdefg", "1234567")
str1 = "say goodbye"
str2 = str1.translate(dict1)

dict2 = "".maketrans("1234567", "abcdefg")
str3 = str2.translate(dict2)
print(str3)